# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1SuggestKnowledgeAssistResponse do
  @moduledoc """
  The response message for Participants.SuggestKnowledgeAssist.

  ## Attributes

  *   `contextSize` (*type:* `integer()`, *default:* `nil`) - Number of messages prior to and including latest_message to compile the suggestion. It may be smaller than the SuggestKnowledgeAssistRequest.context_size field in the request if there are fewer messages in the conversation.
  *   `knowledgeAssistAnswer` (*type:* `GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1KnowledgeAssistAnswer.t`, *default:* `nil`) - Output only. Knowledge Assist suggestion.
  *   `latestMessage` (*type:* `String.t`, *default:* `nil`) - The name of the latest conversation message used to compile suggestion for. Format: `projects//locations//conversations//messages/`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contextSize => integer() | nil,
          :knowledgeAssistAnswer =>
            GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1KnowledgeAssistAnswer.t()
            | nil,
          :latestMessage => String.t() | nil
        }

  field(:contextSize)

  field(:knowledgeAssistAnswer,
    as: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1KnowledgeAssistAnswer
  )

  field(:latestMessage)
end

defimpl Poison.Decoder,
  for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1SuggestKnowledgeAssistResponse do
  def decode(value, options) do
    GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1SuggestKnowledgeAssistResponse.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowV2beta1SuggestKnowledgeAssistResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
